package al.xc.common.util;

import java.lang.annotation.Annotation;
import java.util.function.Function;

public class ReflectUtils {
    /**
     * 获取注解值
     * @param tClass
     * @param aClass
     * @param func
     * @param <T>
     * @param <A>
     * @param <R>
     * @return
     */
    public static <T, A extends Annotation, R>  R obAnnotionVl(Class<T> tClass, Class<A> aClass, Function<A, R> func) {
        A annotation = tClass.getAnnotation(aClass);
        if (null == annotation) {
            return null;
        }
        return func.apply(annotation);
    }
}
